package cn.tedu.apps_system.pojo.dto;

import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
public class OrderItemRequestDto {
    @NotNull(message = "商品ID不能为空")
    private Long productId;

    @NotBlank(message = "商品名称不能为空")
    private String productName;

    private String productImage; // 可选字段

    @NotNull(message = "商品单价不能为空")
    @DecimalMin(value = "0.01", message = "单价必须大于0")
    private Double price;

    @NotNull(message = "购买数量不能为空")
    @Min(value = 1, message = "数量至少为1")
    private Integer quantity;
}
